package qst0921_2.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import qst0921_2.dao.UserDao;
import qst0921_2.entity.User;
import qst0921_2.service.UserService;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;

    public  User selectOne(Integer id) {
        return userDao.selectOne(id);
    }

    public List<User> selectAll() {

        return userDao.selectAll();
    }

    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public void insert2(User u1, User u2) {
        userDao.insert(u1);
        userDao.insert(u2);
    }

    public void delete(User user) {
        userDao.delete(user);
    }
}
